import numpy as np
import pandas as pd
from pandas import Series,DataFrame

import json

db = json.load(open('../datasets/usda_food/database.json'))
print len(db)
# print db

print db[0].keys()
print db[0]['nutrients'][0]

nutrients = DataFrame(db[0]['nutrients'])
print nutrients[:7]

info_keys = ['description', 'group', 'id', 'manufacturer']
info = DataFrame(db, columns=info_keys)
print info.head()
print info
print "-----------------------"
print info.group
print pd.value_counts(info.group)[:10]

